/*
 * @Author: xiangrikui 1755283163@qq.com
 * @Date: 2024-06-19 16:27:26
 * @LastEditors: xiangrikui 1755283163@qq.com
 * @LastEditTime: 2024-06-20 20:34:55
 * @FilePath: \项目\src\services\demo\register.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { request } from '@umijs/max';

// 重置密码

export async function reset(email:string,userPassword:string,checkPassword:string,emailCode: string) {
  try{
    return request(`/api/user/reset`, {
    method: 'POST',
    data: {
      email,
      userPassword,
      checkPassword,
      emailCode,
    },
  });
  return response.data;  // 假设 response.data 包含用户信息或token等
} catch (error) {
  // 处理错误情况
  console.error('Error logging in:', error);
  throw error;  // 可以选择抛出错误，供调用者进一步处理
}
  }

